package com.guzhi.service.impl;

import com.guzhi.mapper.EmpLogMapper;
import com.guzhi.pojo.EmpLog;
import com.guzhi.service.EmpLogService;
import com.guzhi.service.EmpLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class EmpLogServiceImpl implements EmpLogService {

    @Autowired
    private EmpLogMapper empLogMapper;

    @Transactional(propagation = Propagation.REQUIRED)//添加事务，即使调用这个接口的方法有它的事务，也要确保这个方法能正确执行（也就是不管怎样单独弄一个事务，不管其他，都要执行）
    @Override
    public void insertLog(EmpLog empLog) {
        empLogMapper.insert(empLog);
    }
}
